﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddNew.ascx.cs" Inherits="WebClient.admin.Modules.users.AddNew" %>

<script type="text/javascript">
    var txtMy = "ctl00_ContentPlaceHolder2_ctl00_txt";
    var Err = "Err";
    var ArrField = new Array("userName", "fullName", "password", "email");
    function ClearAll() {
        var l = ArrField.length;
        for (var i = 0; i < l; i++) {
            var myVal = document.getElementById(txtMy + ArrField[i]);
            myVal.value = "";

        }

        HideAll();
        var myCtrl = document.getElementById(txtMy + ArrField[0]);
        myCtrl.focus();
        return false;
    }
    function HideAll() {
        var l = ArrField.length;
        for (var i = 0; i < l; i++) {
            var myVal = document.getElementById(Err + ArrField[i]);
            myVal.style.display = 'none';
        }
        return false;
    }
    function OnSubmitClick() {
        HideAll();
        var errExisting = false;
        var l = ArrField.length;
        var Errfocus = false;
        for (var i = 0; i < l; i++) {
            var myVal = document.getElementById(txtMy + ArrField[i]);
            if (myVal.value == "") {
                var obj = document.getElementById(Err + ArrField[i]);
                obj.style.display = 'block';
                errExisting = true;
            }
            if (errExisting && !Errfocus) {
                myVal.focus();
                Errfocus = true;
            }
        }

        return !errExisting;
    }   
</script>

<table cellpadding="0" cellspacing="0" border="0">
    <tr height="25">
        <td>
            <span style="font-family: Helvetica; font-size: 13px; color: Green; font-weight: bold">
                </span></td>
    </tr>
    
    <tr>
        <td>
            <div runat="server" id="MyUpdate">
                <table id='tbSearch' width="735" cellpadding="2" cellspacing="0" rules="rows"  border="1"
                    style="border-collapse: collapse">
					 
					 <tr>
						<td align="left" class="left">userName :</td>
						<td class="center"><asp:TextBox width="300px" id="txtuserName" runat="server" 
						 textmode="SingleLine" CssClass="lsbOpenDay" emptymessage="" skin="Outlook" EnableViewState="true"></asp:TextBox><span>(*)</span></td >
						<td class="right" ><div id="ErruserName" class="Err" style="display:none;">Lỗi</div></td>
					</tr>
					 <tr>
						<td align="left" class="left">fullName :</td>
						<td class="center"><asp:TextBox width="300px" id="txtfullName" runat="server" 
						 textmode="SingleLine" CssClass="lsbOpenDay" emptymessage="" skin="Outlook" EnableViewState="true"></asp:TextBox><span>(*)</span></td >
						<td class="right" ><div id="ErrfullName" class="Err" style="display:none;">Lỗi</div></td>
					</tr>
					 <tr>
						<td align="left" class="left">password :</td>
						<td class="center">
                            <asp:TextBox width="300px" id="txtpassword" runat="server" 
						 textmode="Password" CssClass="lsbOpenDay" emptymessage="" skin="Outlook" EnableViewState="true"></asp:TextBox><span>(*)</span></td >
						<td class="right" ><div id="Errpassword" class="Err" style="display:none;">Lỗi</div></td>
					</tr>
					 <tr>
						<td align="left" class="left">email :</td>
						<td class="center"><asp:TextBox width="300px" id="txtemail" runat="server" 
						 textmode="SingleLine" CssClass="lsbOpenDay" emptymessage="" skin="Outlook" EnableViewState="true"></asp:TextBox><span>(*)</span></td >
						<td class="right" ><div id="Erremail" class="Err" style="display:none;">Lỗi</div></td>
					</tr>
					
					 <tr>
						<td align="left" class="left">group :</td>
						<td class="center"><span>(<asp:DropDownList ID="cbbgroupId" runat="server" 
                                Width="300px">
                            </asp:DropDownList>
                            *)</span></td >
						<td class="right" ><div id="ErrgroupID" class="Err" style="display:none;">Lỗi</div></td>
					</tr>
					 
					 
					 
					 <tr>
						<td align="left" class="left">address :</td>
						<td class="center"><asp:TextBox width="300px" id="txtaddress" runat="server" 
						 textmode="SingleLine" CssClass="lsbOpenDay" emptymessage="" skin="Outlook" EnableViewState="true"></asp:TextBox><span>(*)</span></td >
						<td class="right" ><div id="Erraddress" class="Err" style="display:none;">Lỗi</div></td>
					</tr>
					 <tr>
						<td align="left" class="left">phone :</td>
						<td class="center"><asp:TextBox width="300px" id="txtphone" runat="server" 
						 textmode="SingleLine" CssClass="lsbOpenDay" emptymessage="" skin="Outlook" EnableViewState="true"></asp:TextBox><span>(*)</span></td >
						<td class="right" ><div id="Errphone" class="Err" style="display:none;">Lỗi</div></td>
					</tr>
					 
					<tr>
						<td align="center" colspan="3">
							<asp:Button runat="server" ID="btnAddNew" Text="Thêm mới" Font-Names="Helvetica"
							BorderStyle="Solid" BorderWidth="1" onclick="btnAddNew_Click"/>
							<asp:Button runat="server" ID="btnCancel" Text="Nhập lại" Font-Names="Helvetica"
							BorderStyle="Solid" BorderWidth="1"/>
						</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
</table>
